﻿using System;
using XCI.Core;
using XCI.Extensions;

namespace XCI.Windows
{
    /// <summary>
    /// 系统报表Ribbon视图模块
    /// </summary>
    [FormCaption("系统报表Ribbon视图模块")]
    public partial class FrmReportRibbonView : BaseForm
    {
        public FrmReportRibbonView()
        {
            InitializeComponent();
        }

        private async void FrmReportRibbonView_Load(object sender, EventArgs e)
        {
            //工具栏
            if (Args.Get("toolbar", () => "1").Equals("0"))
            {
                ribbonControl1.Visible = false;
            }
            //状态栏
            if (Args.Get("statusbar", () => "1").Equals("0"))
            {
                ribbonStatusBar1.Visible = false;
            }

            var code = Args.Get("code");
            var name = Args.Get("name");
            var reportObject = new ReportObject(code, name);
            await reportObject.LoadAsync(this);
            reportObject.View(documentViewer1);
        }
    }
}
